<?php

	class CommonPlugin
	{
		protected $master;
		protected $db;
		protected $sql;
		
		function __construct( &$master )
		{
			$this->master =& $master;
			$this->db     =& $master->getDatabase();
			
			$this->sql    = new XMLSQL( $master->config->directories->queries . $this->getNamespace() . ".xml" );
		}
		
		public function getNamespace()
		{
			return @constant( get_class($this) ."::namespace" );
		}
		
		public function xmlQuery( $name, $array = Array() )
		{
			return $this->db->query( $this->sql->get( $name, $array ) );
		}
	}

?>
